﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NGourd.Core.Assertions
{
    public static class StandardAssertions
    {
        public static void AreEqual<T>(this IAssertions assert, T expected, T actual) where T : IEquatable<T>
        {
            assert.That(
                expected.Equals(actual), // Erm what if expected is null?
                String.Format("Expected {0} but got {1}",
                    expected, actual
                )
            );
        }

        public static void IsNotNull<T>(this IAssertions assert, T obj) where T : class
        {
            assert.That(obj != null, "Expected non-null value");
        }

        public static void IsNull<T>(this IAssertions assert, T obj) where T : class
        {
            assert.That(obj == null, "Expected null value");
        }
    }
}
